#!/usr/bin/env python
import glob
import os

files = glob.glob("PE*")
for file in files:
    if(os.path.isdir(file) ):
        os.chdir(file)
        os.system("""sampleImagePoints --img %s --thresh -800 800 --numPoints 2000"""%(file+".mha"))
        os.chdir("../")
        #raw_input('continue')

